package ecom.beans;

import ecom.beans.exception.AccountBeanException;
import ecom.beans.exception.DAONotFoundException;
import ecom.beans.exception.DAONotUniqueException;
import ecom.beans.exception.ProductBeanException;
import ecom.beans.exception.ProductcategoryException;
import ecom.beans.exception.ProductstoreBeanException;
import ecom.beans.exception.StockBeanException;
import ecom.beans.exception.UserBeanException;
import java.util.Set;
import javax.ejb.Remote;

@Remote
public interface EcomAdminRemote {

    Long createProductStore(String name, String adress, String postalCode, String city, String tel, String iban, Double balance) throws DAONotUniqueException, ProductstoreBeanException, AccountBeanException;

    void createAccount(String iban, Double balance) throws AccountBeanException, DAONotUniqueException;

    Set<ProductcategoryBean> getAllCategories(String order);

    Long createProduct(String name, Long idProductcategory) throws ProductBeanException;

    Long createEntireProduct(String name, String description, String urlPhoto, Long idProductcategory) throws ProductBeanException;

    void createStock(Long idProductstore, Long idProduct, Integer quantity, Double price) throws DAONotUniqueException;

    Long createProductcategory(String name) throws DAONotUniqueException, ProductcategoryException;

    void updateProduct(Long idProduct, String name, String description, String urlPhoto, Long idProductcategory) throws DAONotFoundException;

    void updateProductcategory(Long idProductcategory, String name) throws DAONotFoundException;

    void updateProductstore(Long idProductstore, String name, String adress, String postalCode, String city, String tel) throws DAONotFoundException;

    void removeProductstore(Long idProductstore) throws DAONotFoundException;

    void removeProduct(Long idProduct) throws DAONotFoundException;

    void removeProductcategory(Long idProductcategory) throws DAONotFoundException;

    void removeAccount(String iban) throws AccountBeanException, DAONotUniqueException;

    UserBean getUserByPseudoAndPassword(String login, String password) throws DAONotFoundException;

    ProductcategoryBean getProductcategoryByName(String name) throws DAONotUniqueException;

    Set<AccountBean> getAllAccounts();

    Set<ProductBean> getAllProducts(String order);

    Set<ProductstoreBean> getAllStores(String order);

    ProductstoreBean getProductstoreById(Long idProductstore) throws DAONotFoundException;

    ProductBean getProductById(Long idProduct) throws DAONotFoundException;

    StockBean getStockByIdProductstoreAndIdProduct(Long idProductstore, Long idProduct) throws DAONotFoundException;

    Set<UserBean> getAllUsers();

    Long createUser(String pseudo, String password, String email, boolean isAdmin, String iban, Double balance) throws UserBeanException, DAONotUniqueException, AccountBeanException;

    public Long createUser(String pseudo, String password, String email, String adress, String postalCode, String city, String country, String currency, String tel, boolean isAdmin, String iban, Double balance) throws UserBeanException, DAONotUniqueException, AccountBeanException;

    void removeUser(String pseudo, String password) throws DAONotFoundException;

    Set<PurchaseBean> getAllPurchases(String order);

    Set<StockBean> getAllStocks(String order);

    void removeStock(Long idProductstore, Long idProduct) throws StockBeanException, DAONotFoundException;

    void updateStockQuantity(Long idProductstore, Long idProduct, Integer quantity) throws DAONotFoundException;

    Set<StockBean> getBestStocks(String order, Integer limit);
}
